<?PHP
/**
 * $Rev: 9 $
 * $Id: tag.php 9 2013-03-02 20:39:36Z vad.oparin@gmail.com $
 */
class tag {
	protected $tag;
	protected $attributes;
	protected $children;
	
	public function __toString() {
		return implode("\r\n", $this->children);
	}
	
	public function setAttr($attribute, $value) {
		$this->attributes[$attribute] = $value;
	}
	
	public function getAttr($attribute) {
		return $this->attributes[$attribute];
	}
	
	public function append($content) {
		array_push($content);
	}
	
	public function prepend($content) {
		array_unshift($this->children, $content);
	}
}
